<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/my.css">
<script type="text/javascript" src="../../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
<script>
if(window.name != "bencalie"){
    location.reload();
    window.name = "bencalie";
}
else{
    window.name = "";
}
</script>
</head>
<body>
	<%@include file="header.jsp" %>
	<div class="container">
		<form class="form-horizontal well well-lg" method="post" action="../../PutMessage" role="form">
			<h3><strong>公告板</strong></h3>
			<div class="form-group">
				<div class="col-sm-7">
					<input type="text" name="title" placeholder="请输入公告主题*" class="form-control input-lg">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-7">
					<textarea rows="10" name="content" placeholder="请输入公告内容*" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-3">
					<input type="submit" name="publish" value="发布" class="form-control btn btn-primary ">
				</div>
			</div>
		</form>
<%
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		if(application.getAttribute("messageCount")!=null){
			int count=(int)application.getAttribute("messageCount");
			for(int i=0;i<count;i++){
				out.print("<div class=\"panel panel-info\"><div class=\"panel-heading\"><div>");
				out.print(application.getAttribute("messageTitle"+i));
				out.print("</div></div><div class=\"panel-body\"><div>");
				out.print(application.getAttribute("messageContent"+i));
				out.print("</div></div></div>");
			}
		}
		%>
	</div>
</body>
</html>